2024 Method
Changes 0
M

BeamSystem.Create

Description:
Creates a new BeamSystem with specified profile curves.
public static BeamSystem Create(
	Document document,
	IList<Curve> profile,
	Level level,
	int curveIndexForDirection,
	bool is3d
)
  • document
    The document in which the new BeamSystem is created.
  • IList<Curve>
    profile
    The profile of the BeamSystem.
  • level
    The level on which the BeamSystem is to be created. The work-plane of the BeamSystem will be the sketch plane associated with the Level. If there is no current sketch plane associated with the level yet, we will create a default one.
  • Int32
    curveIndexForDirection
    Index of the curve in the profile to be used as direction. '0' means the direction to use the first curve in profile. The curve from the profile to be used as direction must be a Line.
  • Boolean
    is3d
    Whether the BeamSystem is 3D. If the BeamSystem is 3D, the sketchPlane must be a level, otherwise an exception will be thrown.
Return Value BeamSystem If successful, a new BeamSystem object will be returned.
// Build a profile for the beam system creation
XYZ first = new XYZ(0, 0, 0);
XYZ second = new XYZ(40, 0, 0);
XYZ third = new XYZ(40, 25, 0);
XYZ fourth = new XYZ(0, 25, 0);
List<Curve> profile = new List<Curve>();
profile.Add(Line.CreateBound(first, second));
profile.Add(Line.CreateBound(second, third));
profile.Add(Line.CreateBound(third, fourth));
profile.Add(Line.CreateBound(fourth, first));

// Create a beam system
BeamSystem beamSystem = BeamSystem.Create(document, profile, level, 0, false);
if (null != beamSystem)
{
    // Change some properties, such as elevation
    Parameter elevationPara = beamSystem.get_Parameter(BuiltInParameter.INSTANCE_ELEVATION_PARAM);
    if (null != elevationPara)
    {
        elevationPara.Set(10.0);
    }
}